package com.aruio.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Description TODO
 * @Date 2024/8/20 8:49
 * @Created by 10574
 */
@RestController()
@RequestMapping("gatewayFilter")
@Slf4j
public class GatewayFilterTestController {
    private static final String TEST_HEADER = "X-Request-Test";

    @RequestMapping("addRequestHeader")
    public void addRequestHeader(HttpServletRequest request) {
        log.info("获取请求头:{}, 值:{}", TEST_HEADER, request.getHeader(TEST_HEADER));
    }

    @RequestMapping("addRequestParameter")
    public String addRequestHeader(@RequestParam("test") String test) {
        return "收到键值对, test:" +  test;
    }
}
